﻿@model RuTracker.MVC.Models.Settings.SettingsModel

@{
    ViewBag.Title = "Settings";
}

<!DOCTYPE html>

<html>
    <head>
        <link href="@Url.Content("~/Styles/style.css")" rel="stylesheet" type="text/css" />
        <link href="@Url.Content("~/Styles/validation.css")" rel="stylesheet" type="text/css" />
        <meta name="viewport" content="width=device-width" />
        <title>Settings</title>
    </head>
<body>
        @using (Html.BeginForm())
        {
           <div align="center">
                  <table>
                    <tr>
                        <td>
                         <table class="borderedTable">
                            <tr>
                                <td>
                                    <div align="left" class="field-table">
                                        @Html.LabelFor(x => x.UserName)
                                    </div>
                                </td>
                                <td>
                                    <div align="left" class="field-table">
                                        @Html.DisplayTextFor(x => x.UserName)
                                    </div>
                                </td>
                                <td />
                            </tr>
                            <tr>
                                <td>
                                    <div align="left" class="field-table">
                                        @Html.LabelFor(x => x.EMail)
                                    </div>
                                </td>
                                <td>
                                    <div align="left" class="field-table">
                                        @Html.TextBoxFor(x => x.EMail)
                                    </div>
                                </td>
                                <td>
                                    <div class="field-table">
                                        @Html.ValidationMessageFor(x => x.EMail)
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div align="left" class="field-table">
                                        @Html.LabelFor(x => x.DropboxFolderPath)
                                    </div>
                                </td>
                                <td>
                                    <div align="center" class="field-table">
                                        @if (string.IsNullOrEmpty(Model.DropboxFolderPath))
                                        {
                                            if (Model.HaveToken)
                                            {
                                                @Html.ActionLink("Select", "SelectDropboxFolder")
                                            }
                                            else
                                            {
                                                @Html.ActionLink("Login to Dropbox", "GetDropboxAccess")
                                            }

                                        }
                                        else
                                        {
                                            @Html.ActionLink(Model.DropboxFolderPath, "SelectDropboxFolder")
                                        }
                                    </div>
                                </td>
                            </tr>
                        </table>    
                    </td>
                </tr>
                <tr>
                    <td>
                        <input id="submitButton" type="submit" value="Save" />
                    </td>
                </tr>
            </table>
            </div>
        }
</body>
</html>
